var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        im.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        im.dispose()
    } else {
        if (status === a++) {
            im.updateInfoQuest(27038, "itemid=5010178");
            im.gainItem(5010178, 1);
            im.gainItem(2630776, -1);
            im.dispose()
        }
    }
};